package com.wq.code;

import java.io.*;
import java.util.Base64;

/**
 * @Author: wangqiang20995
 * @Date:2019/5/21
 * @Description:
 * @Resource:
 */
public class FinalClassDemo {

    private final int number;

    private static final String name;

    {

        number = 1;
        System.out.println("实例化加载");
    }

    static {
        name = "George";
        System.out.println("类对象初始化加载");
    }

    public static void main(String[] args) throws IOException {
        System.out.println("123");
        String str = "eyJyZXFzZXJpYWwiOiIyMDE5MDUyNTE0MjUzMDQwMjA0OCJ9";

        String s =new String(Base64.getDecoder().decode(str));

        System.out.println(s);

        FileInputStream fileInputStream = new FileInputStream("C:\\Users\\Michael\\Desktop\\filetransfer-config.xml");

        StringBuilder builder = new StringBuilder();

        BufferedReader reader = new BufferedReader(new InputStreamReader(fileInputStream));

        String line = null;

        while ((line = reader.readLine()) != null){
            builder.append(line);
        }

        String result = builder.toString();
        if(result.indexOf("<") != -1 && result.lastIndexOf(">") != -1 && result.lastIndexOf(">") > result.indexOf("<")){
            System.out.println(1);
        }else {
            System.out.println(2);
        }

    }
}
